import { getPatientMedicineOrderDetailAPI } from '@/apis/medicine'
import type { MedicineOrderDetail } from '@/types/medicine'
import { ref } from 'vue'

/**
 * 获取订单详情
 *  * @param orderId 订单ID
 * @returns 订单详情
 */
export const useOrderDetail = (orderId: string) => {
	const orderDetail = ref<MedicineOrderDetail>()

	// 获取订单详情
	const loadOrderDetail = async () => {
		if (!orderId) return
		const res = await getPatientMedicineOrderDetailAPI(orderId)
		orderDetail.value = res.data
	}
	loadOrderDetail()
  return { orderDetail }
}
